class Solution {
    //写个快排，其实不必，用Array.sort
    public static int[] insertSort(int[] array){
        int[] div = array.clone();
        for (int i = 1; i < div.length; i++) {
            int temp = div[i];
            int j = i-1;
            for ( ; j >=0 ; j--) {
                if(div[j] < temp){
                    div[j+1] = div[j];
                }else{
                    div[j+1] = temp;
                    break;
                }
            }
            if(j<0){
                div[0] = temp;
            }
        }
        return div;
    }
    public static String[] findRelativeRanks(int[] score) {
        int[] div = insertSort(score);
        HashMap<Integer,String> map = new HashMap<>();
        int i = 0;
        if(i < div.length) {
            map.put(div[i++], "Gold Medal");
        }
        if(i < div.length) {
            map.put(div[i++], "Silver Medal");
        }
        if(i < div.length) {
            map.put(div[i++], "Bronze Medal");
        }
        for (; i < div.length; i++) {
            map.put(div[i],Integer.toString(i+1));
        }
        String[] str = new String[score.length];
        for (int j = 0; j < str.length; j++) {
            str[j] = map.get(score[j]);
        }
        return str;
    }

}